import time

from config import BACK_URL
from page.page_back_login import BackLoginPage
from page.page_limit_review import ReviewPage
from tools import DriverTools


class TestLimit:
    def setup_method(self):
        self.driver = DriverTools.get_driver()
        self.driver.get(BACK_URL)
        self.limit = BackLoginPage(self.driver)
        self.limit1 = ReviewPage(self.driver)
        self.limit.back_login('admin', 'HM_2023_test', '8888')

    def teardown_method(self):
        # 关闭浏览器
        DriverTools.quit_driver()

    def test_back_login(self):
        self.limit1.review()
        self.limit1.review_search(phone='13845555578')
        self.limit1.review_result()
        self.limit1.get_shot('limit.png')